home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_wolfshack.cog < prev    next >
Text File  |  1999-11-15  |  19KB  |  792 lines

  1. # Jones 3D Cog Script
  2. #
  3. # olv_wolfshack.cog   
  4. #
  5. # [SCHOLL]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message entered
  13. message    startup
  14. message    aievent
  15. message    arrivedwpnt
  16. message killed
  17. message timer
  18.  
  19. thing    t_Wolf
  20. thing    t_Indy        local
  21. thing   t_Com1
  22. thing   t_Com2
  23.  
  24. int        n_eventType        local
  25. int        n_CrntAIMode     local
  26. int        n_OldAIMode     local
  27. int        n_Waypoint        local
  28. flex    f_DistToIndy    local 
  29. int        n_TimerID        local 
  30. flex    f_FleeTime        local
  31. int        n_IndyWaypoint    local
  32.  
  33. int        b_OKToStopFlee=0         local
  34. int        b_AttackOnStopFlee=0     local
  35. int        n_idx                    local
  36. int        b_WpntsActive=0            local
  37. int        n_FleeDir                local
  38.  
  39. vector    v_IndyPos        local
  40. vector    v_WolfPos        local
  41.  
  42.  
  43.  
  44. # ===========================FLEE WAYPOINTS================================================
  45. int            NUM_FLEE_WAYPOINTS=31            local
  46. thing        t_Waypoint00
  47. thing        t_Waypoint01
  48. thing        t_Waypoint02
  49. thing        t_Waypoint03
  50. thing        t_Waypoint04
  51. thing        t_Waypoint05
  52. thing        t_Waypoint06
  53. thing        t_Waypoint07
  54. thing        t_Waypoint08
  55. thing        t_Waypoint09
  56. thing        t_Waypoint10
  57. thing        t_Waypoint11
  58. thing        t_Waypoint12
  59. thing        t_Waypoint13
  60. thing        t_Waypoint14
  61. thing        t_Waypoint15
  62. thing        t_Waypoint16
  63. thing        t_Waypoint17
  64. thing        t_Waypoint18
  65. thing        t_Waypoint19
  66. thing        t_Waypoint20
  67. thing        t_Waypoint21
  68. thing        t_Waypoint22
  69. thing        t_Waypoint23
  70. thing        t_Waypoint24
  71. thing        t_Waypoint25
  72. thing        t_Waypoint26
  73. thing        t_Waypoint27
  74. thing        t_Waypoint28
  75. thing        t_Waypoint29
  76. thing        t_Waypoint30
  77.  
  78.  
  79. # ===========================SECTORS================================================
  80.  
  81. int            NUM_AUTO_FLEE_SECTORS=3     local
  82. sector        s_AutoFlee00            mask=0x5 # need entered messages from wolf
  83. sector        s_AutoFlee01            mask=0x5 # need entered messages from wolf
  84. sector        s_AutoFlee02            mask=0x5 # need entered messages from wolf
  85.  
  86. int            NUM_ACTIVATE_WPNT_SECTORS=2 local
  87. sector        s_ActivateWpnts00
  88. sector        s_ActivateWpnts01
  89.  
  90. int            NUM_DEACTIVATE_WPNT_SECTORS=2 local
  91. sector        s_DeactivateWpnts00
  92. sector        s_DeactivateWpnts01
  93.  
  94.  
  95. # ===========================MISC CONSTANTS================================================
  96.  
  97. flex    MIN_FLEE_DISTANCE=2.0            local # distance wolf wants to be from Indy before stopping fleeing
  98. flex    MIN_FLEE_RESTART_DISTANCE=1.0            local # distance wolf wants to be from Indy before stopping fleeing
  99. flex    MAX_FLEEATTACK_DISTANCE=1.0            local # 
  100. flex    MIN_FLEE_TIME=4.0                local 
  101. flex    VARIABLE_FLEE_TIME=3.0            local
  102.  
  103. int        TIMER_ID_OKAY_TO_STOP_FLEE=0    local
  104. int        TIMER_ID_START_FLEE=1            local
  105. int        TIMER_ID_ATTACK=2                local
  106. int     TIMER_ID_ENABLE_WOLF=3          local
  107.  
  108. # ===========================SUBROUTINES================================================
  109.  
  110. flex    SetDistToIndy            local
  111. flex    ActivateWaypoints        local
  112. flex    DeactivateWaypoints        local
  113. flex    RankWaypointsForFlee     local
  114. flex    RankWaypointsForFleeToSouthWest local
  115. flex    RankWaypointsForFleeToSouthEast local
  116. flex     RankWaypointsForFleeToNorthWest    local
  117. flex     RankWaypointsForFleeToNorthEast    local
  118. flex    ResetWaypointRanks        local
  119.  
  120. end
  121. # ========================================================================================
  122.  
  123. code
  124. startup:
  125.     
  126.     t_Indy=GetLocalPlayerThing();
  127.     SetThingFlags(t_Wolf, 0x80000);
  128.     return;
  129.  
  130. # ========================================================================================
  131. entered:
  132.     if (GetSourceRef() == t_Indy)
  133.     {
  134.         for (n_idx = 0; n_idx < NUM_ACTIVATE_WPNT_SECTORS; n_idx = n_idx + 1)
  135.         {
  136.             if (GetSenderRef() == s_ActivateWpnts00[n_idx])
  137.             {
  138.                 call ActivateWaypoints;
  139.             }
  140.         }
  141.         for (n_idx = 0; n_idx < NUM_DEACTIVATE_WPNT_SECTORS; n_idx = n_idx + 1)
  142.         {
  143.             if (GetSenderRef() == s_DeactivateWpnts00[n_idx])
  144.             {
  145.                 call DeactivateWaypoints;
  146.             }
  147.         }
  148.     }
  149.     else if (GetSourceRef() == t_Wolf)
  150.     {
  151.         for (n_idx = 0; n_idx < NUM_AUTO_FLEE_SECTORS; n_idx = n_idx + 1)
  152.         {
  153.             if (GetSenderRef() == s_AutoFlee00[n_idx])
  154.             {
  155. //                DebugPrint("Wolf auto fleeing");
  156.                 AIFlee(t_Wolf, t_Indy);
  157.             }
  158.         }
  159.     }
  160.  
  161.     return;
  162.  
  163. # ========================================================================================
  164. aievent:
  165.     n_eventType        = GetParam(0);
  166.     n_CrntAIMode    = GetParam(1);
  167.     n_OldAIMode        = GetParam(2);    // only valid for certain n_eventType values
  168.  
  169.     if (n_eventType == 0x100)        // SITHAI_EVENTMODECHANGED
  170.     {
  171.         // if changing to flee mode
  172.         // turn on waypoints
  173.         if ( !BITTEST(n_OldAIMode, 0x800) && BITTEST(n_CrntAIMode, 0x800) )
  174.         {
  175. //            DebugPrint("Entering flee mode");
  176.             AISetSubMode(t_Wolf, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION
  177.             f_FleeTime = (MIN_FLEE_TIME + (Rand() * VARIABLE_FLEE_TIME));
  178. //            DebugFlex( f_FleeTime, "Flee time");
  179.             SetTimerEx(f_FleeTime , TIMER_ID_OKAY_TO_STOP_FLEE, 0, 0 );
  180.             b_OKToStopFlee = 0;
  181.             call RankWaypointsForFlee;
  182.         }
  183.         // if exiting flee mode
  184.         // turn off waypoints
  185.         else if ( BITTEST(n_OldAIMode, 0x800) && !BITTEST(n_CrntAIMode, 0x800) )
  186.         {
  187.             call SetDistToIndy;
  188.         
  189.             if (b_AttackOnStopFlee)
  190.             {
  191.                 SetTimerEx(0.01 , TIMER_ID_ATTACK, 0, 0);
  192.                 b_AttackOnStopFlee = 0;
  193.                 AIClearSubMode(t_Wolf, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION
  194.                 call ResetWaypointRanks;
  195.             }
  196.             // Consider restarting fleeing if Indy too close
  197.             else if (f_DistToIndy < MIN_FLEE_RESTART_DISTANCE)
  198.             {
  199. //                DebugFlex(f_DistToIndy, "Wolf restarting fleeing due to distance");
  200.                 // Restart using timer to avoid nested mode changes
  201.                 SetTimerEx(0.01 , TIMER_ID_START_FLEE, 0, 0 );
  202.             }
  203.             else
  204.             {
  205.                 AIClearSubMode(t_Wolf, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION
  206.                 call ResetWaypointRanks;
  207. //                DebugPrint("Exiting flee mode");
  208.             }
  209.         }
  210.     }
  211.  
  212. return;
  213.  
  214. # ========================================================================================
  215. killed:
  216.  
  217.     if(GetSenderRef() == t_Com1) t_Com1 = -1;
  218.     if(GetSenderRef() == t_Com2) t_Com2 = -1;
  219.     
  220.     if((t_Com1 == -1) && (t_Com2 == -1) && (GetSenderRef() != t_Wolf))
  221.     {
  222.         SetTimerEx(20.0, TIMER_ID_ENABLE_WOLF, 0, 0);
  223.     }
  224.     
  225.     return;
  226.     
  227. # ========================================================================================
  228. timer:
  229.     t_Indy = GetLocalPlayerThing();
  230.  
  231.     n_TimerID = GetSenderID();
  232.     if (n_TimerID == TIMER_ID_OKAY_TO_STOP_FLEE)
  233.     {
  234.         b_OKToStopFlee = 1;
  235.     }
  236.     else if (n_TimerID == TIMER_ID_START_FLEE)
  237.     {
  238.         call RankWaypointsForFlee;
  239.         AIFlee(t_Wolf, t_Indy);
  240.     }
  241.     else if (n_TimerID == TIMER_ID_ATTACK)
  242.     {
  243.         AISetFireTarget(t_Wolf, t_Indy);
  244.     }
  245.  
  246.     else if (n_TimerID == TIMER_ID_ENABLE_WOLF)
  247.     {
  248.         if(HasLOS(t_Wolf, t_Indy))
  249.         {
  250.             SetTimerEx(20.0, TIMER_ID_ENABLE_WOLF, 0, 0);
  251.         }
  252.         
  253.         else
  254.         {
  255.             ClearThingFlags(t_Wolf, 0x80000);
  256.         }
  257.     }
  258.  
  259.     return;
  260.  
  261.  
  262. # ========================================================================================
  263. arrivedwpnt:
  264.     n_Waypoint = GetParam(0);
  265.  
  266.     call SetDistToIndy;
  267.  
  268.     if ( b_OKToStopFlee 
  269.          && (f_DistToIndy > MIN_FLEE_DISTANCE)
  270.          && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  271.          && (RandBetween(0,100) < 90)
  272.          )
  273.     {
  274. //        DebugFlex(f_DistToIndy, "Wolf stopping fleeing due to distance");
  275.         // StopThing before StopFlee so wolf will turn to face indy
  276.         StopThing(t_Wolf);
  277.         AIStopFlee(t_Wolf);
  278.     }
  279.     else if ( b_OKToStopFlee 
  280.          && (f_DistToIndy < MAX_FLEEATTACK_DISTANCE)
  281.          && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  282.          && (RandBetween(0,100) < 30)
  283.          )
  284.     {
  285. //        DebugFlex(f_DistToIndy, "Wolf stopping fleeing. Surprise attack");
  286.         b_AttackOnStopFlee = 1;
  287.         AIStopFlee(t_Wolf);
  288.     }
  289.     else if ( (n_FleeDir == -1)
  290.               && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  291.               )
  292.     {
  293.         // fleeing south
  294.         if (n_Waypoint <=2)
  295.         {
  296.             if (f_DistToIndy > MIN_FLEE_RESTART_DISTANCE)
  297.             {
  298.                 // StopThing before StopFlee so wolf will turn to face indy
  299. //                DebugPrint("Wolf Reached Flee Waypoint and Stopped.");
  300.                 StopThing(t_Wolf);
  301.                 AIStopFlee(t_Wolf);
  302.             }
  303.             else
  304.             {
  305. //                DebugFlex(f_DistToIndy, "Wolf Restarting fleeing.");
  306.                 call RankWaypointsForFlee;
  307.             }
  308.         }
  309.     }
  310.     else if ( (n_FleeDir == 0)
  311.               && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  312.               )
  313.     {
  314.         // fleeing north/east
  315.         if (n_Waypoint == 25)
  316.         {
  317.             if (f_DistToIndy > MIN_FLEE_RESTART_DISTANCE)
  318.             {
  319.                 // StopThing before StopFlee so wolf will turn to face indy
  320. //                DebugPrint("Wolf Reached Flee Waypoint and Stopped.");
  321.                 StopThing(t_Wolf);
  322.                 AIStopFlee(t_Wolf);
  323.             }
  324.             else
  325.             {
  326. //                DebugFlex(f_DistToIndy, "Wolf Restarting fleeing.");
  327.                 call RankWaypointsForFlee;
  328.             }
  329.         }
  330.     }
  331.     else if ( (n_FleeDir == 1)
  332.               && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  333.               )
  334.     {
  335.         // fleeing south/east
  336.         if (n_Waypoint == 3)
  337.         {
  338.             if (f_DistToIndy > MIN_FLEE_RESTART_DISTANCE)
  339.             {
  340.                 // StopThing before StopFlee so wolf will turn to face indy
  341. //                DebugPrint("Wolf Reached Flee Waypoint and Stopped.");
  342.                 StopThing(t_Wolf);
  343.                 AIStopFlee(t_Wolf);
  344.             }
  345.             else
  346.             {
  347. //                DebugFlex(f_DistToIndy, "Wolf Restarting fleeing.");
  348.                 call RankWaypointsForFlee;
  349.             }
  350.         }
  351.     }
  352.     else if ( (n_FleeDir == 2)
  353.               && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  354.               )
  355.     {
  356.         // fleeing south/west
  357.         if (n_Waypoint == 2)
  358.         {
  359.             if (f_DistToIndy > MIN_FLEE_RESTART_DISTANCE)
  360.             {
  361.                 // StopThing before StopFlee so wolf will turn to face indy
  362. //                DebugPrint("Wolf Reached Flee Waypoint and Stopped.");
  363.                 StopThing(t_Wolf);
  364.                 AIStopFlee(t_Wolf);
  365.             }
  366.             else
  367.             {
  368. //                DebugFlex(f_DistToIndy, "Wolf Restarting fleeing.");
  369.                 call RankWaypointsForFlee;
  370.             }
  371.         }
  372.     }
  373.     else if ( (n_FleeDir == 3)
  374.               && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  375.               )
  376.     {
  377.         // fleeing north/west
  378.         if (n_Waypoint == 30)
  379.         {
  380.             if (f_DistToIndy > MIN_FLEE_RESTART_DISTANCE)
  381.             {
  382.                 // StopThing before StopFlee so wolf will turn to face indy
  383. //                DebugPrint("Wolf Reached Flee Waypoint and Stopped.");
  384.                 StopThing(t_Wolf);
  385.                 AIStopFlee(t_Wolf);
  386.             }
  387.             else
  388.             {
  389. //                DebugFlex(f_DistToIndy, "Wolf Restarting fleeing.");
  390.                 call RankWaypointsForFlee;
  391.             }
  392.         }
  393.     }
  394.  
  395.     return;
  396.  
  397. # ========================================================================================
  398. SetDistToIndy:
  399.     v_IndyPos = GetThingPos(t_Indy);
  400.     v_WolfPos = GetThingPos(t_Wolf);
  401.  
  402.     f_DistToIndy = VectorDist(v_IndyPos, v_WolfPos);
  403.  
  404.     return;
  405.  
  406. # ========================================================================================
  407. ActivateWaypoints:
  408.     if (b_WpntsActive)
  409.     {
  410.         return;
  411.     }
  412.  
  413. //    DebugPrint("ACTIVATING WAYPOINTS FOR WOLF IN SHACK AREA");
  414.     b_WpntsActive = 1;
  415.     AISetInstinctWpntMode(t_Wolf);
  416.     
  417.     if(t_Com1 > -1)
  418.     {
  419.         AISetInstinctWpntMode(t_Com1);
  420.         AIEnableInstinct(t_Com1, "roam", 1);
  421.     }
  422.     
  423.     if(t_Com2 > -1)
  424.     {
  425.         AISetInstinctWpntMode(t_Com2);
  426.         AIEnableInstinct(t_Com2, "roam", 1);
  427.     }
  428.     
  429.     for ( n_idx = 0; n_idx < NUM_FLEE_WAYPOINTS; n_idx = n_idx + 1 )
  430.     {
  431.         AISetWpnt(t_Waypoint00[n_idx], n_idx);
  432.     }
  433.  
  434.     AIConnectWpnts(0, 1);
  435.     AIConnectWpnts(0, 2);
  436.     AIConnectWpnts(0, 4);
  437.     AIConnectWpnts(1, 2);
  438.     AIConnectWpnts(1, 3);
  439.     AIConnectWpnts(2, 5);
  440.     AIConnectWpnts(3, 7);
  441.     AIConnectWpnts(4, 5);
  442.     AIConnectWpnts(4, 6);
  443.     AIConnectWpnts(5, 8);
  444.     AIConnectWpnts(6, 8);
  445.     AIConnectWpnts(6, 11);
  446.     AIConnectWpnts(6, 12);
  447.     AIConnectWpnts(7, 9);
  448.     AIConnectWpnts(7, 10);
  449.     AIConnectWpnts(8, 12);
  450.     AIConnectWpnts(8, 13);
  451.     AIConnectWpnts(8, 19);
  452.     AIConnectWpnts(9, 14);
  453.     AIConnectWpnts(9, 15);
  454.     AIConnectWpnts(10, 15);
  455.     AIConnectWpnts(10, 16);
  456.     AIConnectWpnts(10, 24);
  457.     AIConnectWpnts(10, 25);
  458.     AIConnectWpnts(11, 12);
  459.     AIConnectWpnts(11, 17);
  460.     AIConnectWpnts(11, 18);
  461.     AIConnectWpnts(12, 13);
  462.     AIConnectWpnts(12, 18);
  463.     AIConnectWpnts(12, 19);
  464.     AIConnectWpnts(12, 22);
  465.     AIConnectWpnts(13, 14);
  466.     AIConnectWpnts(13, 19);
  467.     AIConnectWpnts(14, 19);
  468.     AIConnectWpnts(14, 20);
  469.     AIConnectWpnts(15, 20);
  470.     AIConnectWpnts(15, 23);
  471.     AIConnectWpnts(15, 24);
  472.     AIConnectWpnts(16, 24);
  473.     AIConnectWpnts(16, 25);
  474.     AIConnectWpnts(17, 18);
  475.     AIConnectWpnts(17, 21);
  476.     AIConnectWpnts(18, 19);
  477.     AIConnectWpnts(18, 22);
  478.     AIConnectWpnts(18, 26);
  479.     AIConnectWpnts(19, 20);
  480.     AIConnectWpnts(19, 23);
  481.     AIConnectWpnts(19, 28);
  482.     AIConnectWpnts(20, 23);
  483.     AIConnectWpnts(20, 24);
  484.     AIConnectWpnts(21, 26);
  485.     AIConnectWpnts(21, 29);
  486.     AIConnectWpnts(22, 26);
  487.     AIConnectWpnts(22, 27);
  488.     AIConnectWpnts(23, 24);
  489.     AIConnectWpnts(23, 28);
  490.     AIConnectWpnts(24, 25);
  491.     AIConnectWpnts(26, 29);
  492.     AIConnectWpnts(26, 30);
  493.     AIConnectWpnts(27, 28);
  494.     AIConnectWpnts(29, 30);
  495.  
  496.     return;
  497.  
  498. # ========================================================================================
  499. DeactivateWaypoints:
  500.     if (!b_WpntsActive)
  501.     {
  502.         return;
  503.     }
  504.  
  505. //    DebugPrint("DEACTIVATING WAYPOINTS FOR WOLF SHACK");
  506.     b_WpntsActive = 0;
  507.     AIClearInstinctWpntMode(t_Wolf);
  508.     StopThing(t_Wolf);
  509.     
  510.     if(t_Com1 > -1) AIClearInstinctWpntMode(t_Com1);
  511.     if(t_Com2 > -1) AIClearInstinctWpntMode(t_Com2);
  512.     
  513.     return;
  514.  
  515.  
  516. # ========================================================================================
  517. RankWaypointsForFlee:
  518.     t_Indy = GetLocalPlayerThing();  // Indy could be in raft
  519.  
  520.     n_IndyWaypoint = AIFindNearestWpnt(t_Indy);
  521.  
  522.     if (n_IndyWaypoint >= 26)
  523.     {
  524.         call RankWaypointsForFleeToSouthEast;
  525.     }
  526.     else if (n_IndyWaypoint >= 23)
  527.     {
  528.         call RankWaypointsForFleeToSouthWest;
  529.     }
  530.     else if (n_IndyWaypoint >= 17)
  531.     {
  532.         call RankWaypointsForFleeToSouthEast;
  533.     }
  534.     else if (n_IndyWaypoint >= 14)
  535.     {
  536.         call RankWaypointsForFleeToSouthWest;
  537.     }
  538.     else if (n_IndyWaypoint >= 11)
  539.     {
  540.         call RankWaypointsForFleeToSouthEast;
  541.     }
  542.     else if (n_IndyWaypoint >= 9)
  543.     {
  544.         call RankWaypointsForFleeToSouthWest;
  545.     }
  546.     else if (n_IndyWaypoint == 8)
  547.     {
  548.         call RankWaypointsForFleeToSouthEast;
  549.     }
  550.     else if (n_IndyWaypoint == 7)
  551.     {
  552.         call RankWaypointsForFleeToNorthWest;
  553.     }
  554.     else if (n_IndyWaypoint >= 4)
  555.     {
  556.         call RankWaypointsForFleeToNorthEast;
  557.     }
  558.     else if (n_IndyWaypoint == 3)
  559.     {
  560.         call RankWaypointsForFleeToNorthWest;
  561.     }
  562.     else if (n_IndyWaypoint == 2)
  563.     {
  564.         call RankWaypointsForFleeToNorthEast;
  565.     }
  566.     else if (n_IndyWaypoint == 1)
  567.     {
  568.         call RankWaypointsForFleeToNorthWest;
  569.     }
  570. //    else if (n_IndyWaypoint == 0)
  571.     else
  572.     {
  573.         call RankWaypointsForFleeToNorthEast;
  574.     }
  575.     
  576.  
  577.     return;
  578.  
  579. # ========================================================================================
  580. RankWaypointsForFleeToSouthEast:
  581.  
  582. //    DebugPrint("Rank waypoints for Flee To SouthEast");
  583.     n_FleeDir = 1;
  584.  
  585.     AISetWpntRank(3, 40);
  586.     
  587.     AISetWpntRank(1, 35);
  588.     AISetWpntRank(7, 35);
  589.  
  590.     AISetWpntRank(0, 30);
  591.     AISetWpntRank(2, 30);
  592.     AISetWpntRank(9, 30);
  593.     AISetWpntRank(10, 30);
  594.  
  595.     AISetWpntRank(4, 25);
  596.     AISetWpntRank(5, 25);
  597.     AISetWpntRank(14, 25);
  598.     AISetWpntRank(15, 25);
  599.     AISetWpntRank(16, 25);
  600.     AISetWpntRank(24, 25);
  601.  
  602.     AISetWpntRank(6, 20);
  603.     AISetWpntRank(8, 20);
  604.     AISetWpntRank(13, 20);
  605.     AISetWpntRank(20, 20);
  606.     AISetWpntRank(23, 20);
  607.  
  608.     AISetWpntRank(11, 15);
  609.     AISetWpntRank(12, 15);
  610.     AISetWpntRank(19, 15);
  611.     AISetWpntRank(28, 15);
  612.     AISetWpntRank(25, 15);
  613.     
  614.     AISetWpntRank(17, 10);
  615.     AISetWpntRank(18, 10);
  616.     AISetWpntRank(22, 10);
  617.     AISetWpntRank(27, 10);
  618.  
  619.     AISetWpntRank(21, 5);
  620.     AISetWpntRank(26, 5);
  621.     
  622.     AISetWpntRank(29, 0);
  623.     AISetWpntRank(30, 0);
  624.  
  625.  
  626.     return;
  627.  
  628.  
  629. # ========================================================================================
  630. RankWaypointsForFleeToNorthWest:
  631.  
  632. //    DebugPrint("Rank waypoints for Flee To NorthWest");
  633.     n_FleeDir = 3;
  634.  
  635.     AISetWpntRank(3, 25);
  636.     AISetWpntRank(1, 25);
  637.  
  638.     AISetWpntRank(0, 30);
  639.     AISetWpntRank(2, 30);
  640.     AISetWpntRank(7, 30);
  641.     AISetWpntRank(10, 30);
  642.     AISetWpntRank(16, 30);
  643.     AISetWpntRank(25, 30);
  644.  
  645.     AISetWpntRank(4, 35);
  646.     AISetWpntRank(5, 35);
  647.     AISetWpntRank(9, 35);
  648.     AISetWpntRank(15, 35);
  649.     AISetWpntRank(24, 35);
  650.  
  651.     AISetWpntRank(6, 40);
  652.     AISetWpntRank(8, 40);
  653.     AISetWpntRank(13, 40);
  654.     AISetWpntRank(14, 40);
  655.     AISetWpntRank(20, 40);
  656.     AISetWpntRank(23, 40);
  657.     AISetWpntRank(28, 40);
  658.     
  659.     AISetWpntRank(11, 45);
  660.     AISetWpntRank(12, 45);
  661.     AISetWpntRank(19, 45);
  662.     AISetWpntRank(27, 45);
  663.  
  664.     AISetWpntRank(17, 50);
  665.     AISetWpntRank(18, 50);
  666.     AISetWpntRank(22, 50);
  667.  
  668.     AISetWpntRank(21, 55);
  669.     AISetWpntRank(26, 55);
  670.     AISetWpntRank(29, 55);
  671.     
  672.     AISetWpntRank(30, 60);
  673.  
  674.  
  675.     return;
  676.  
  677. # ========================================================================================
  678.  
  679. RankWaypointsForFleeToSouthWest:
  680.  
  681. //    DebugPrint("Rank waypoints for Flee To SouthWest");
  682.     n_FleeDir = 2;
  683.  
  684.     AISetWpntRank(2, 65);
  685.  
  686.     AISetWpntRank(0, 60);
  687.     
  688.     AISetWpntRank(1, 55);
  689.     AISetWpntRank(5, 55);
  690.  
  691.     AISetWpntRank(3, 50);
  692.     AISetWpntRank(4, 50);
  693.  
  694.     AISetWpntRank(6, 45);
  695.     AISetWpntRank(7, 45);
  696.     AISetWpntRank(8, 45);
  697.  
  698.     AISetWpntRank(9, 40);
  699.     AISetWpntRank(10, 40);
  700.     AISetWpntRank(11, 40);
  701.     AISetWpntRank(12, 40);
  702.     AISetWpntRank(13, 40);
  703.     AISetWpntRank(19, 40);
  704.  
  705.     AISetWpntRank(14, 35);
  706.     AISetWpntRank(15, 35);
  707.     AISetWpntRank(16, 35);
  708.     AISetWpntRank(17, 35);
  709.     AISetWpntRank(18, 35);
  710.     AISetWpntRank(22, 35);
  711.     AISetWpntRank(28, 35);
  712.  
  713.     AISetWpntRank(20, 30);
  714.     AISetWpntRank(21, 30);
  715.     AISetWpntRank(23, 30);
  716.     AISetWpntRank(24, 30);
  717.     AISetWpntRank(25, 30);
  718.     AISetWpntRank(26, 30);
  719.     AISetWpntRank(27, 30);
  720.  
  721.     AISetWpntRank(29, 25);
  722.     AISetWpntRank(30, 25);
  723.  
  724.     return;
  725.  
  726.  
  727. # ========================================================================================
  728.  
  729. RankWaypointsForFleeToNorthEast:
  730.  
  731. //    DebugPrint("Rank waypoints for Flee To NorthEast");
  732.     n_FleeDir = 0;
  733.     AISetWpntRank(4, 30);
  734.     AISetWpntRank(5, 30);
  735.     AISetWpntRank(21, 30);
  736.     AISetWpntRank(29, 30);
  737.     AISetWpntRank(30, 30);
  738.     
  739.     AISetWpntRank(0, 35);
  740.     AISetWpntRank(2, 35);
  741.     AISetWpntRank(6, 35);
  742.     AISetWpntRank(8, 35);
  743.     AISetWpntRank(11, 35);
  744.     AISetWpntRank(17, 35);
  745.     AISetWpntRank(26, 35);
  746.  
  747.     AISetWpntRank(1, 40);
  748.     AISetWpntRank(12, 40);
  749.     AISetWpntRank(13, 40);
  750.     AISetWpntRank(18, 40);
  751.     AISetWpntRank(22, 40);
  752.     AISetWpntRank(27, 40);
  753.  
  754.     AISetWpntRank(3, 45);
  755.     AISetWpntRank(9, 45);
  756.     AISetWpntRank(14, 45);
  757.     AISetWpntRank(19, 45);
  758.     AISetWpntRank(28, 45);
  759.  
  760.     AISetWpntRank(7, 50);
  761.     AISetWpntRank(15, 50);
  762.     AISetWpntRank(20, 50);
  763.     AISetWpntRank(23, 50);
  764.  
  765.     AISetWpntRank(10, 55);
  766.     AISetWpntRank(16, 55);
  767.     AISetWpntRank(24, 55);
  768.  
  769.     AISetWpntRank(25, 60);
  770.  
  771.     return;
  772.  
  773.  
  774. # ========================================================================================
  775. ResetWaypointRanks:
  776.  
  777. //    DebugPrint("Reset waypoint ranks");
  778.  
  779.     n_FleeDir = 0;
  780.     for ( n_idx = 0; n_idx < NUM_FLEE_WAYPOINTS; n_idx = n_idx + 1 )
  781.     {
  782.         AISetWpntRank(n_idx, 0);
  783.     }
  784.  
  785.     return;
  786.  
  787.  
  788.  
  789.  
  790. end
  791.  
  792.